//
//  ST_BTIMGiftMessageModel.swift
//  btvideo
//
//  Created by mac on 2020/6/30.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import NIMSDK
import SwiftyJSON

enum ST_IMGoodsType:Int {
    /**
     礼物
     */
    case gift = 0
    /**
     守护
     */
    case sweetGuard = 1
    /**
     会员
     */
    case give_member = 2
    /**
     人脸认证
     */
    case requireDetect = 3
    
    /**
     搭讪
     */
    case accost = 4
}


class ST_BTIMGiftMessageModel:ST_BTMessageAttachDecoder{

    /**
     商品id ,会员类型消息为 【1,2,3】表示1个月 2个月 3个月, 人脸认证暂时不需要id
     */
    var goodsId = ""
    var title = ""
    var subTitle = ""
    var imageUrl = ""
    var svgaUrl:String?
    var logGiftId:String?
    var income:Float = 0.0
    var type = ST_IMGoodsType.gift

//    新增 展示使用
    var intimacy:Int = 0
    var giftName = ""
//    新增，3.0.5 ,礼物数量，默认1
    var giftNumber = 1
    /// 是盲盒
    var isBlindBox = false
    
    override func encode() -> String {
        
        let dict = ["type":self.type.rawValue,"goodsId":self.goodsId,"title":self.title,"subTitle":self.subTitle,"imageUrl":self.imageUrl,"msgType":231] as [String : Any]
        
        let json = JSON(dict)
        
        let res = json.rawString() ?? ""
        
        return res
    }
    
}

